#ifndef STATEMACHINE_DEF
#define STATEMACHINE_DEF

#include "Tools.h"

enum{QUIT, MENU, GAME, PLAY, PAUSE, NEW_GAME, BUILDING, MORTAR, MISSILE, SELL, SELECT, DONE, NEXT_WAVE, SPAWNING, EMPTY, DEBRIS, OBSTACLE, ENDING};

/////////////////////////// STATE MACHINES ///////////////////////////// 
// GLOBAL
//  END <- MENU <-> GAME, MENU <-> OPTION
// enum {QUIT, MENU, OPTION, GAME};

// GLOBAL
// UNPAUSE <-> PAUSE
// enum {PLAY, PAUSE};

// MENU
// PLAY_B -> PLAY_B_OK, PLAY_B <-> OPTION_B, OPTION_B -> OPTION_B_OK, OPTION_B <-> EXIT_B, EXIT_B -> EXIT_B_OK, EXIT_B <-> PLAY_B  
// enum {PLAY_B, OPTION_B, EXIT_B, NEW_GAME_B, PLAY_B_OK, OPTION_B_OK, EXIT_B_OK, NEW_GAME_B_OK};

// OPTION
// DONE -> DONE_OK, DONE <-> LIFE, LIFE -> LIFE_UP -> LIFE, LIFE -> LIFE_DOWN -> LIFE
// enum {DONE_B, LIFE_B, DONE_B_OK, LIFE_B_UP, LIFE_B_DOWN};

// GAME
// SELECT -> *_C -> BUILDING (except for SELL_C), SELECT -> SELL 
// enum {BUILDING, PLAY_C, PAUSE_C, MORTAR_C, MISSILE_C, SELL, SELECT, CONFIRM_BUY, MENU_C};

// WORLD
// NEXT_WAVE -> SPAWNING, END
// enum {NEXT_WAVE, SPAWNING, END};

// CREEP & TOWER
enum {STAND, ATTACK, DIE, ARRIVED, WALKN, WALKS, WALKE, WALKW, OUTN, OUTS, OUTE, OUTW};
////////////////////////////////////////////////////////////////////////

typedef struct StateMachine StateMachine;
struct StateMachine{
	State main;
	State pause;
	State menu;
	State game;
	State creep;
};

#endif
